package com.yuanqi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 盘点明细
 * @TableName ware_stock_count_item
 */
@TableName(value ="ware_stock_count_item")
@Data
public class WareStockCountItem implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 盘点单ID
     */
    private Long stockCountId;

    /**
     * 库位ID
     */
    private Long locationId;

    /**
     * SKU ID
     */
    private Long skuId;

    /**
     * 批次号
     */
    private String batchNo;

    /**
     * 系统数量
     */
    private BigDecimal systemQty;

    /**
     * 盘点数量
     */
    private BigDecimal countQty;

    /**
     * 差异数量=盘点-系统
     */
    private BigDecimal diffQty;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WareStockCountItem other = (WareStockCountItem) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStockCountId() == null ? other.getStockCountId() == null : this.getStockCountId().equals(other.getStockCountId()))
            && (this.getLocationId() == null ? other.getLocationId() == null : this.getLocationId().equals(other.getLocationId()))
            && (this.getSkuId() == null ? other.getSkuId() == null : this.getSkuId().equals(other.getSkuId()))
            && (this.getBatchNo() == null ? other.getBatchNo() == null : this.getBatchNo().equals(other.getBatchNo()))
            && (this.getSystemQty() == null ? other.getSystemQty() == null : this.getSystemQty().equals(other.getSystemQty()))
            && (this.getCountQty() == null ? other.getCountQty() == null : this.getCountQty().equals(other.getCountQty()))
            && (this.getDiffQty() == null ? other.getDiffQty() == null : this.getDiffQty().equals(other.getDiffQty()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStockCountId() == null) ? 0 : getStockCountId().hashCode());
        result = prime * result + ((getLocationId() == null) ? 0 : getLocationId().hashCode());
        result = prime * result + ((getSkuId() == null) ? 0 : getSkuId().hashCode());
        result = prime * result + ((getBatchNo() == null) ? 0 : getBatchNo().hashCode());
        result = prime * result + ((getSystemQty() == null) ? 0 : getSystemQty().hashCode());
        result = prime * result + ((getCountQty() == null) ? 0 : getCountQty().hashCode());
        result = prime * result + ((getDiffQty() == null) ? 0 : getDiffQty().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", stockCountId=").append(stockCountId);
        sb.append(", locationId=").append(locationId);
        sb.append(", skuId=").append(skuId);
        sb.append(", batchNo=").append(batchNo);
        sb.append(", systemQty=").append(systemQty);
        sb.append(", countQty=").append(countQty);
        sb.append(", diffQty=").append(diffQty);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}